//
//  MBDGroupCommentsTitleCell.swift
//  MasterBoy
//
//  Created by kyson on 2024/8/27.
//

import Foundation
import YYText


class MBDGroupCommentsTitleCell : MBDCommonCell {
    var titleLabel : YYLabel!

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        self.initialize()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        
        self.initialize()
    }
    
    override var cellModel: Any!{
        didSet {
            let realCellModel = self.cellModel as! MBDGroupCommentsTitleCellModel
            self.titleLabel.textLayout = realCellModel.groupCommentsTitleLayout

        }
    }

    func initialize() {
        self.commonBackgroundView.setDynamicForgroundColor()
        self.contentView.setDynamicForgroundColor()
        self.separateLine.isHidden = true

        titleLabel = YYLabel()
        self.commonBackgroundView.addSubview(titleLabel)
        
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(7)
            make.centerY.equalToSuperview()
            make.width.equalToSuperview().offset(-14)
        }
    }
}
